/**
 * Created by mola on 15-12-11.
 */
'use strict';
let fs = require('fs');
class Config {
    /** @constructor **/
    constructor() {
        /**
         * @access private
         * @return {string}
         */
        this.loadConfig = function() {
            return JSON.parse(fs.readFileSync('../config/server.json'));
        };
    }

    /**
     * load value from config by key
     * @param {string | number} key - key of value
     * @returns {*}
     */
    valueByKey(key) {
        let config = this.loadConfig();
        return config[key];
    }
}